home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-03
/
qbasicpg.zip
/
GREETING.BAS
< prev
next >
Wrap
BASIC Source File
|
1989-08-31
|
626b
|
18 lines
' GREETING.BAS
' This program demonstrates the LTRIM$ and RTRIM$ functions.
DIM firstName AS STRING * 12 ' declare fixed-length strings
DIM lastName AS STRING * 15
CLS
' get first and last names
INPUT "Enter your first name: ", firstName
INPUT "Enter your last name: ", lastName
PRINT ' print greeting without trimming
PRINT "Nice to meet you, "; firstName; " "; lastName; "!"
' print compliment with trimming
PRINT "I think "; LTRIM$(RTRIM$(firstName)); " ";
PRINT LTRIM$(RTRIM$(lastName)); " has a nice ring to it."